package jianzhi_offer;

public class _6_斐波那契数列 {
	
	public static void main(String[] args) {
		_6_斐波那契数列 test = new _6_斐波那契数列();
		test.Fibonacci(2);
	}
	public int Fibonacci(int n) {
		if(n == 0) return 1;
		if(n == 1) return 1;
		int pre = 0 ,before = 1;
		for(int i=2;i<=n;++i) {
			int now = pre+before;
			pre = before;
			before = now;
			System.out.println(now);
		}
		return before;
    }
}
